package com.xz.usercenter.service;

import com.xz.usercenter.model.domain.User;
import com.baomidou.mybatisplus.extension.service.IService;

import javax.servlet.http.HttpServletRequest;

/**
* @author 徐洲
* @description 针对表【user】的数据库操作Service
* @createDate 2024-04-21 15:24:31
*/
public interface UserService extends IService<User> {
    /**
     * 用户注册
     * @param userAccount 用户账号
     * @param userPassword 用户密码
     * @param checkPassword 重复密码
     * @param verificationCode 校验码
     * @return 用户id
     */
    long userRegister(String userAccount, String userPassword, String checkPassword, String verificationCode);

    /**
     * 用户登录
     * @param userAccount 用户账号
     * @param userPassword 用户密码
     * @return 用户对象
     */
    User userLogin(String userAccount, String userPassword, HttpServletRequest request);

    /**
     * 用户脱敏
     * @param originalUser
     * @return
     */
    User getSafetyUser(User originalUser);

    /**
     * 注销用户
     * @param request
     * @return
     */
    int userLogout(HttpServletRequest request);
}
